<div id="content-box">
		<div class="border">
			<div class="padding">
				<div id="toolbar-box">
   			<div class="t">
				<div class="t">
					<div class="t"></div>
				</div>
			</div>
			<div class="m">
				<div class="toolbar" id="toolbar">
<table class="toolbar"><tr>

<td class="button" id="toolbar-delete">
<a href="#" onclick="javascript:if(document.phpForm.boxchecked.value==0){alert('Vui lòng chọn 1 mục từ danh sách để');}else{  submitbutton('remove')}" class="toolbar">
<span class="icon-32-delete" title="Xóa">
</span>
Xóa
</a>
</td>

<td class="button" id="toolbar-help">
<a href="#" onclick="popupWindow('', 'Trợ giúp', 640, 480, 1)" class="toolbar">
<span class="icon-32-help" title="Trợ giúp">
</span>
Trợ giúp
</a>
</td>

</tr></table>
</div>
<div class="header icon-48-massemail">Quản lý thông tin liên hệ</div>

				<div class="clr"></div>
			</div>
			<div class="b">
				<div class="b">
					<div class="b"></div>
				</div>
			</div>
  		</div>
   		<div class="clr"></div>
				
				
		<div id="element-box">
			<div class="t">
		 		<div class="t">
					<div class="t"></div>
		 		</div>
			</div>
			<div class="m">
		<form method="post" name="phpForm">
		<table class="adminlist">
		<thead>
		<?php include("../protected/dbconnect.php");
			include("../protected/back_end_paging.php");
			
			$sql = "SELECT `contact`.`Id`, `contact`.`name`, `contact`.`email`, `contact`.`company`, `contact`.`address`, 
					`contact`.`phone`, `contact`.`fax`, `contact`.`title`, `contact`.`content`, `contact`.`date_add`, `contact`.`view`
					FROM `contact`";
					
			$cmd = $mysqli->prepare($sql);
			$cmd->execute();
			$cmd->bind_result($Id, $name, $email, $company, $address, $phone, $fax, $title, $content ,$date_add, $view);
			$cmd->store_result();
			if(!isset($_POST["limit"])) $r = 10; else $r = $_POST["limit"];
			if(!isset($_POST["page"])) $p = 1; else $p = $_POST["page"];
			$pager = Pager::getPagerData($cmd->num_rows, $r, $p);
			$i = 1;
		?>
			<tr>
				<th width="10"># </th>
				<th width="10"><input name="toggle" value="" onclick="checkAll(<?php echo $r; ?>);" type="checkbox"></th>
				<th width="30%"><a href="javascript:void(0)">Thông tin người liện hệ</a></th>
				<th width="50%"><a href="javascript:void(0)">Nội dung liên hệ</a></th>
				<th width="10%"><a href="javascript:void(0)">Phản hồi</a></th>
				<th width="1%"><a href="javascript:void(0)">ID</a></th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="13">
					<del class="container">
						Bạn đang xem trang: <?php echo $pager->page ?> của tổng số <?php echo $pager->numPages ?> trang <br>
							<?php echo $pager->paging ?> <br>
							Hiển thị #
							<select name="limit" class="inputbox" size="1" onchange="document.phpForm.submit();">
								<?php 
									for($j = 5; $j <= 50; $j = $j + 5){ 
										if($j == $r){ ?>
											<option value="<?php echo $j ?>" selected><?php echo $j ?></option>
										<?php } else { ?>
											<option value="<?php echo $j ?>"><?php echo $j ?></option>
										<?php }
									}
								?>
							</select>
							mẫu tin trên mỗi trang
						</div>
					</del>
				</td>
			</tr>
		</tfoot>
		<tbody>
		<?php while($cmd->fetch()){ 
			if($i > $pager->offset && $i <= $pager->limit){
		?>
			<tr class="row0">
			<td align="center"><?php echo $i ?></td>
			<td><input type="checkbox" id="cb<?php echo $i ?>" name="cid[]" value="<?php echo $Id ?>" onclick="isChecked(this.checked);" /></td>
			<td>
				<table cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td>Họ tên: </td>
						<td><?php echo $name ?> </td>
					</tr>
					<tr>
						<td>Email: </td>
						<td><?php echo $email ?> </td>
					</tr>
					<tr>
						<td>công ty: </td>
						<td><?php echo $company ?> </td>
					</tr>
					<tr>
						<td>Địa chỉ: </td>
						<td><?php echo $address ?> </td>
					</tr>
					<tr>
						<td>Điện thoại: </td>
						<td><?php echo $phone ?> </td>
					</tr>
					<tr>
						<td>Fax: </td>
						<td><?php echo $fax ?> </td>
					</tr>
				</table>			
			</td>
			<td>
				<table cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td>Tiêu đề: <?php echo $title ?> </td>
					</tr>
					<tr>
						<td>Nội dung: <br>
							<textarea cols="60" rows="10"><?php echo $content ?></textarea> 
						</td>
					</tr>					
				</table>
			</td>
			<td align="center"><a class="modal" title="Trả lời thông tin liên hệ"  href=".?com=com_contact&view=reply&id=<?php echo $Id ?>" rel="{handler: 'iframe', size: {x: 600, y: 450}}"><img src="images/nomail.png"></a></td>
			<td align="center"><?php echo $Id ?></td>
			</tr>
		<?php }	
		$i++;
		} ?>
		</tbody>
		</table>

		<input type=hidden name=page value=<?php echo $p; ?>>
		<INPUT type=hidden value=submit_com_contact_view name=hidden>
		<INPUT type=hidden value=0 name=boxchecked>
		<INPUT type=hidden name=task>
		</form>
		
				<div class="clr"></div>
			</div>
			<div class="b">
				<div class="b">
					<div class="b"></div>
				</div>
			</div>
   		</div>
		<noscript>
			!Cảnh báo! Javascript phải được bật để chạy được các chức năng trong phần Quản trị				</noscript>
		<div class="clr"></div>
	</div>
	<div class="clr"></div>
</div>
</div>
	<div id="border-bottom"><div><div></div></div></div>